package cassandra;
// This class is a image of the mymed ring
import java.util.List;
import java.util.Map;

import org.apache.cassandra.dht.Token;

import utils.RingUtils;

public class Ring {
	Map<String, String> loadMap;
	List<String> upNodes; 
	List<String> downNodes;
	Map<Token, String> tokenNodes;

	RingUtils ringUtils;

	public Ring (Map<String, String> loadMap,
			List<String> upNodes, 
			List<String> downNodes,
			Map<Token, String> tokenNodes) {
		this.loadMap = loadMap;
		this.upNodes = upNodes; 
		this.downNodes = downNodes;
		this.tokenNodes = tokenNodes;
		ringUtils = RingUtils.getInstance();
	}


	public List<Float> getOrderedLoadList () {

		return	 ringUtils.getLoadList(loadMap);

	}



	public Map<String, String> getLoadMap() {
		return loadMap;
	}






	public List<String> getUpNodes() {
		return upNodes;
	}



	public List<String> getDownNodesStopNotPlanned() {
		return downNodes;
	}

	public List<String> getDownNodes() {
		return downNodes;
	}


	public Map<Token, String> getTokenNodes() {
		return tokenNodes;
	}



	public int getNodeNumber (){
		return tokenNodes.keySet().size();
	}

}
